{template 'common/header'}
<link href="{MODULE_URL}template/web/css/classlist.css" rel="stylesheet" type="text/css">
    <div class="list_th">
        <div class="td" style=" width:20%;">
            <div class="left_padding">看板名称</div>
        </div>
        <div class="td text-center" style=" width:20%;">上班时间/下班时间</div>
        <div class="td text-center" style=" width:20%;">中场休息时间</div>
        <div class="td text-center" style=" width:20%;">假日</div>
        <div class="td text-center" style=" width:20%;">
            <div class="list_right text-center">操作</div>
        </div>
        <div class="clear"></div>
    </div>
    {if $template}
    {loop $template $k $o}
    <div class="list_tr link_bk">
            <div class="td" style=" width:20%;">
                <div class="left_padding">{$o['template_name']}</div>
            </div>
            <div class="td text-center" style=" width:20%;" >
                {$o['start']}-{$o['end']}
            </div>
            <div class="td text-center" style=" width:20%;" >
                {$o['rest_start']}-{$o['rest_end']}
            </div>
            <div class="td text-center" style=" width:20%;" >
                {php echo date_cn($o['rest_week'])}
            </div>                          
            <div class="td edit text-center" style=" width:20%;">
                <div class="list_right btn">
                    <a href="{php echo $this->createWebUrl('timetemplateedit',array('tid'=>$o['tid']));}">修改</a>
                    <a class="gray delete" did="{$o['tid']}">删除</a>

                </div>
            </div>
            <div class="clear"></div>
        </div>
    {/loop}
    {else}
    {/if}
    <div class="list_tr">
        <div class="td" style="width: 60%;">
            <a class="J_add category_list_add" level="1" pid="0" href="{php echo $this->createWebUrl('timetemplateadd');}">添加时间看板</a>
            <div class="clear"></div>
        </div>
    </div>
<div class="list_tr">    
<div class="text-center">
  {php echo $pager;}
</div> 
</div>
<style type="text/css">.right-content{padding: 0;}</style>
<link rel="stylesheet" href="{MODULE_URL}public/css/Toast.css">
<script src="{MODULE_URL}public/js/Toast.js"></script> 
<script type="text/javascript">
    $(document).on('click','.delete', function () {
              if(!confirm("确定要删除该看板吗！")){                
                   window.event.returnValue=false;
               }else{
                   $.ajax({
                       url:"{php echo $this->createWebUrl('timetemplatedel');}&version_id="+"{$_GPC['version_id']}",
                       data:{did:$(this).attr('did')},
                       dataType:"json",
                       type:"post",
                      success:function(res){
                         if(res.status== 1){
                             mqToast({type:1,context: res.msg}); 
                             setTimeout(function(){
                                window.location.reload(); 
                              },2000);
                            
                             return false;
                         }else{
                             mqToast({type:1,context: res.msg}); 
                             return false;
                         }
                      }
                    })                    
               }        
    });    


</script>
{template 'common/footer'}